-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Initial support for Scala 3 #858
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #858 +/- ##
==========================================
- Coverage 88.08% 82.45% -5.64%
==========================================
Files 142 19 -123
Lines 1578 302 -1276
Branches 278 32 -246
==========================================
- Hits 1390 249 -1141
+ Misses 188 53 -135 ☔ View full report in Codecov by Sentry. |
@@ -22,15 +19,16 @@ developers := List( | |||
) | |||
) | |||
|
|||
scalaVersion := "2.13.14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is too optimistic (especially for codecov?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov seemed to work fine on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I meant more for coverage itself. Most of the coverage is on the rules which aren't there for Scala 3 yet. Not sure what test coverage we want to highlight here (or maybe somehow merge a report from 2.12 and 2.13?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your effort! This looks great. I have added some comments.
src/main/scala-3/com/sksamuel/scapegoat/inspections/option/OptionGet.scala
Outdated
Show resolved
Hide resolved
@@ -22,15 +19,16 @@ developers := List( | |||
) | |||
) | |||
|
|||
scalaVersion := "2.13.14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov seemed to work fine on this PR.
Co-authored-by: Bendix Sältz <[email protected]>
@saeltz Could you do another round of review? I think should be minimum viable now to get Scala 3 support going. Slight decrease in project codecov which I think is mostly the Scala 2.13 version checks which don't trigger in Scala 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton!
Let's get this merged and add more and more inspections for Scala 3 iteratively.
@mccartney, would you issue a new release? Maybe even a minor version? We should also properly announce this. |
Hey, really cool to see that you are considering a port to Scala 3. |
3.0.0 is on its way. |
@t1b00 Cool to see this interest! I do think that using Scalameta trees is a nice step forward, as it should (as far I understand) enable more code re-use between Scala 2 and Scala 3 inspections. However, I do think that Scapegoat's reporting is one aspect that wouldn't hold as custom Scalafix rules. This is something that helped me to scale this to hundreds of projects in my company in an "advising" mode, rather than build breaker. To me, one thing that I really like about Scalafix is the capability that it can fix its own findings. So I'm quite interested to see if incorporating Scalameta is feasible, but not sure relying fully on Scalafix will provide the best experience. @mccartney @saeltz Interested to hear your thoughts on this as well. |
Hey, thanks for your answer! Let me clarify a few things about Scalafix and Scalameta since they are a bit opaque and I've acquired quite a bit of experience overtime with them.
That's also the case in Scalafix! Rules can have a severity of Info, Warning or Error, with only error causing compilation errors. Furthermore, it's trivial to activate / deactive rules as one can simply list them in their Scalafix configuration file.
It can, if you write rewrite rules for it. Scalafix is not a linter, but a linter building tool and it was designed for the community to build their own rule sets, not with the idea of it becoming a linter :)
Scalafix allows you to write linter rules or rewrites, but you can simply stick to linter rules if you feel that there is no standard rewrite. Though I could extend some of the rules (e.g. MapGetAndGetOrElse) to a rewrite. I'd be really happy to collaborate with you and the rest of the Scapegoat team on this if you feel like porting to Scalafix and Scalameta is in your interest. |
I'd be happy to see this happening. Anything that brings us closer to full Scala 3 support is desirable. |
Amazing! I think adding my code to the Scapegoat repo would be quite cumbersome as the setup is quite different, but you could definetly indicate this as the WIP version for Scapegoat for Scala 3 if that suits you. Otherwise we can also discuss different modalities. |
Very minimal initial support for Scala 3 (LTS 3.3 and latest 3.4)
Some "obvious" omissions:
I didn't squash the commits to allow you to see my journey and maybe help a bit with reviewing the steps I took. But please squash on merge :)